package x.array;

import java.util.Scanner; //required for input

public class XArray {

    public static void main(String[] args) 
    {
       Scanner keyboard; //records input
       int height;
       int width;
       keyboard=new Scanner(System.in);
       System.out.println("Enter dimension: Width");
       width = keyboard.nextInt(); //sets equal to input
       System.out.println("Enter dimension: Height");
       height = keyboard.nextInt();
       System.out.println("Area=" + (height * width)); 
       for(int i=1;i<=height; i++)
       {
           System.out.println("");
           if(i==1)
           for(int n=0;n<width;n++)
           {
               System.out.print("X");
           }
           else if(i==height)
           {
               for(int n=0;n<width;n++)
               System.out.print("X");
           }
           else
           {
               System.out.print("X");
               for(int n=0;n<width-2;n++)
               {
                   System.out.print(" ");
               }
               System.out.print("X");
           }
           
       }
        System.out.println("");
        System.out.println("");
    }
}
